<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telphone=no, email=no" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="MobileOptimized" content="480" />
    <meta name="screen-orientation" content="portrait" />
    <meta name="x5-orientation" content="portrait" />

</head>
<body>
<div class="page">
    <!-- 头部信息 -->
    <th:block th:include="include :: top"/>
    <div class="center">
        <div class="page-content page-wrap">
            <!-- 左侧导航 -->
            <th:block th:include="include :: left"/>
            <div class="page-wrap-container">

                <div class="claim-apply">
                    <form id="hzxh_unit_claim_search_form" class="page-form">
                        <div class="page-form-item">
                            <div class="page-form-input">
                                <input type="text" style="width:100px" placeholder="姓名" id="personName" value="${hzClaim.person.name}" name="person.name" />
                            </div>
                            <div class="page-form-input">
                                <input type="text" style="width:160px" placeholder="身份证号码" id="idCard" value="${hzClaim.person.idCard}" name="person.idCard" />
                            </div>
                            <div class="page-form-input">
                                <a class="layui-btn layui-btn-primary" onclick="getUnitClaim(${page.pageNo},10)" id="hzxh_unit_claim_search_btn">查询</a>
                            </div>
                            <div class="page-form-input" style="padding-left:10px;">
                                <a class="layui-btn" href="/hzclaim/hzClaimFront/unitClaimApplyInsurance">发起申领申请</a>
                            </div>
                        </div>
                    </form>

                    <h3 style="margin:30px 0 10px 0">办理记录</h3>
                    <!-- <table id="hzxh_unit_claim_list"></table> -->
                    <table class="page-table page-table-list" style="margin-bottom:15px">
                        <tbody>
                        <tr>
                            <th>申领类别</th>
                            <th>活动名称</th>
                            <th>申请会员</th>
                            <th style="width:100px;">办理时间</th>
                            <th>当前步骤</th>
                            <th style="width:80px;">操作</th>
                        </tr>
                        <c:forEach items="${page.list}" var="claim">
                            <tr>
                                <td>${claim.categoryName}</td>
                                <td>${claim.insuranceName}</td>
                                <td>${claim.person.name}<br>${claim.person.idCard}</td>
                                <td>${claim.updateTime}</td>
                                <td>
                                    <c:choose>
                                        <c:when test="${not empty claim.back and claim.back == 1}">
                                            <span style="color:red">申请退回</span>
                                        </c:when>
                                        <c:when test="${not empty claim.stepid}">
                                            <c:if test="${claim.complete == 1}">
                                                <span style="color:green">${claim.stepName}</span>
                                            </c:if>
                                            <c:if test="${claim.complete == 0}">
                                                <span style="color:red">${claim.stepName}</span>
                                            </c:if>
                                        </c:when>
                                        <c:otherwise>
                                            <span style="color:red">上传资料</span>
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td>
                                    <c:choose>
                                        <c:when test="${not empty claim.stepid}">
                                            <a class="layui-btn layui-btn-sm layui-btn-primary" href="/hzclaim/hzClaimFront/unitClaimDetails?id=${claim.id}">查看详情</a>
                                        </c:when>
                                        <c:otherwise>
                                            <a class="layui-btn layui-btn-sm" href="/hzclaim/hzClaimFront/applyUploadClaim?id=${claim.id}">继续申请</a>
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <div class="page-pagination">
                        <!--    当前页之前 -->
                        <span>共${page.count}条记录 ${page.pageNo}/${page.last}</span>
                        <c:choose>
                            <c:when test="${page.pageNo == 1}">
                                <span>首页</span>
                                <span>上一页</span>
                            </c:when>
                            <c:otherwise>
                                <a onclick="getUnitClaim(1,10)">  首页</a>
                                <a onclick="getUnitClaim(${page.pageNo-1},10)">上一页</a>
                                <c:choose>
                                    <c:when test="${(page.pageNo - 5) > 0}">
                                        <c:forEach step="1" begin="${page.pageNo-5}" end="${page.pageNo-1}" varStatus="status">
                                            <a onclick="getUnitClaim(${begin+status.index},10)">${begin+status.index}</a>
                                        </c:forEach>
                                    </c:when>
                                    <c:otherwise>
                                        <c:forEach step="1" begin="1" end="${page.pageNo-1}" varStatus="status">
                                            <a onclick="getUnitClaim(${begin+status.index},10)">${begin+status.index}</a>
                                        </c:forEach>
                                    </c:otherwise>
                                </c:choose>
                            </c:otherwise>
                        </c:choose>
                        <!--      当前页 -->
                        <span>${page.pageNo}</span>
                        <!--  当前页之后 -->
                        <c:choose>
                            <c:when test="${page.pageNo == page.last}">
                                <span>下一页</span>
                                <span>尾页</span>
                            </c:when>
                            <c:otherwise>
                                <a onclick="getUnitClaim(${page.pageNo + 1},10)">${page.pageNo + 1}</a>
                                <a onclick="getUnitClaim(${page.pageNo + 1},10)">  下一页</a>
                                <a onclick="getUnitClaim(${page.last},10)">尾页</a>
                            </c:otherwise>
                        </c:choose>
                    </div>


                    <h3 style="margin:10px 0">所属机构</h3>
                    <table class="page-table">
                        <tr>
                            <th>机构名称</th>
                            <td>${officeInfo.name}</td>
                        </tr>
                    </table>
                </div>

            </div>
        </div>
    </div>
    <!-- 底部信息 -->
    <th:block th:include="include :: footer"/>
</div>

<script type="text/javascript">
    function getUnitClaim(pageNo, pageSize){
        var personName = $('#personName').val();
        var idCard = $('#idCard').val();
        window.location = "/hzclaim/hzClaimFront/unitClaimData?pageNo="+ pageNo +"&pageSize="+ pageSize +"&person.name="+ personName +"&person.idCard="+idCard;
    }
</script>

</body>
</html>
